//    Copyright (C) Kherty.  All rights reserved.
using System;

namespace OpenLS.Spreadsheet.StandardAddIn
{
    internal static class MathHelper
    {
        internal static double XPlus1PowerY(double x, double y)
        {
            if (Math.Abs(x) > 0.5)
                return Math.Pow(x + 1, y);
            return Math.Exp(y*Math.Log(x + 1));
        }

        internal static double XPlus1PowerYMinus1(double x, double y)
        {
            return XPlus1PowerY(x, y) - 1;
        }
    }
}